package com.hzdl.springbootdemo.controller;

import com.hzdl.springbootdemo.bean.UserInfo;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;

/**
 * @author:Asus
 * @date:2020/2/21
 * @description:
 */
@RestController
@RequestMapping("hello")
public class HelloController {

    @Value("${username1}")
    private  String name;

    @RequestMapping("user")
    public UserInfo user(){
        return new UserInfo(22,"小杰伦",new Date());
    }

    @RequestMapping("getusername")
    public String getUserName(){
        return name;
    }
}
